<?php
/**
 * 商品
 */
namespace Model;
defined('IN_IA') or exit('Access Denied');
class GoodsMod extends Mod
{
    public function __construct()
    {
        $this->_table = 'kuyuan_fm_goods';
    }

    /**
     * 获取列表
     * @param $_limit 请求下标
     * @param $_uniacid 公众号id
     * @return array 数据
     */
    public function getList($_limit,$_uniacid)
    {
        $_sql = "
                    SELECT 
                            id,name,images,price,inventory,status
                    FROM
                            ".tablename($this->_table)."
                    WHERE
                            uniacid = :uniacid
                    AND
                            status < 9
                    ORDER BY
                            inventory = 0 DESC,
                            weight DESC
                    LIMIT
                            {$_limit[0]},{$_limit[1]}
                ";
        return pdo_fetchall($_sql,array("uniacid"=>$_uniacid));
    }
}
